import { Key } from 'react'
import { createFetch } from '@/utils/request'
import * as API from '@/services'
import { IResponseData } from '@/services'

export async function queryXllMetas(params: API.XlFolderTreeQueryParams) {
  return createFetch<any, IResponseData<API.XlMeta[]>>('/api/v1/xl-meta', 'GET')(params)
}
export async function queryXlMetaTree(params: API.XlFolderTreeQueryParams) {
  return createFetch<any, IResponseData<API.XlMeta_TreeNode[]>>('/api/v1/xl-meta/tree', 'GET')(params)
}

export async function queryXLMeta(bizId: Key) {
  return createFetch<any, IResponseData<API.XlMeta>>(`/api/v1/xl-meta/${bizId}`, 'GET')(undefined)
}
